- HTML Tutorial
- HTML - Home
- HTML - History and Evolution
- HTML - Overview
- HTML - Editors
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Headings
- HTML - Paragraphs
- HTML - Quotations
- HTML - Comments
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Style Sheet
- HTML - CSS Classes
- HTML - CSS IDs
- HTML - Images
- HTML - Image Map
- HTML Tables
- HTML - Tables
- HTML - Headers & Caption
- HTML - Table Styling
- HTML - Table Colgroup
- HTML - Nested Tables
- HTML Lists
- HTML - Lists
- HTML - Unordered Lists
- HTML - Ordered Lists
- HTML - Definition Lists
- HTML Links
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Iframes
- HTML - Blocks
- HTML Backgrounds
- HTML - Backgrounds
- HTML Colors
- HTML - Colors
- HTML - RGB
- HTML - HEX
- HTML - HSL
- HTML Forms
- HTML - Forms
- HTML - Form Attributes
- HTML - Form Control
- HTML - Input Attributes
- HTML Media
- HTML - Video Element
- HTML - Audio Element
- HTML - Embed Multimedia
- HTML Header
- HTML - Head Element
- HTML - Adding Favicon
- HTML - Javascript
- HTML Layouts
- HTML - Layouts
- HTML - Layout Elements
- HTML - Layout using CSS
- HTML - Responsiveness
- HTML - Symbols
- HTML - Emojis
- HTML - Style Guide
- HTML Graphics
- HTML - SVG
- HTML - Canvas
- HTML APIs
- HTML - Geolocation API
- HTML - Drag & Drop API
- HTML - Web Workers API
- HTML - WebSocket
- HTML - Web Storage
- HTML - Server Sent Events
- HTML Miscellaneous
- HTML - MathML
- HTML - Microdata
- HTML - IndexedDB
- HTML - Web Messaging
- HTML - Web CORS
- HTML - Web RTC
- HTML Demo
- HTML - Audio Player
- HTML - Video Player
- HTML - Web slide Desk
- HTML Tools
- HTML - Velocity Draw
- HTML - QR Code
- HTML - Modernizer
- HTML - Validation
- HTML - Color Code Builder
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
- HTML Resources
- HTML - Quick Guide
- HTML - Useful Resources
- HTML - Color Code Builder
- HTML - Online Editor
HTML - <layer> Tag
The HTML <layer> tag is used to position and animate (through scripting) elements in a page. A layer can be thought of as a separate document that resides on top of the main one, all existing within one window.
This tag was implemented only in thr Netscape4 and is ignored by all other browsers.
Example
Let's look at the following example, where we are going to use the layer tag.
<!DOCTYPE html> <html> <head> <title>HTML layer Tag</title> </head> <body> <layer id = "layer1" top = "250" left = "50" width = "200" height = "200" bgcolor = "red"> <p>layer 1</p> </layer> <layer id = "layer2" top = "350" left = "150" width = "200" height = "200" bgcolor = "blue"> <p>layer 2</p> </layer> <layer id = "layer3" top = "450" left = "250" width = "200" height = "200" bgcolor = "green"> <p>layer 3</p> </layer> </body> </html>
When we run the above code, it will generate an output consisting of the text displayed on the webpage. it will work in Netscape 4 and higher versions.
Global Attributes
This tag supports all the global attributes described in − HTML Attribute Reference
Specific Attributes
The HTML <layer> tag also supports the following additional attributes −
Attribute | Value | Description |
---|---|---|
above | layer name | The name of the inline layer that will be positioned directly above the current layer in the z-order. |
background | URL | A filename or URL for an image upon which the inline layer's text and images will appear. |
below | layer name | The name of the inline layer that will be positioned directly below the current layer in the z-order. |
bgcolor | rgb(x,x,x) #xxxxxx colorname |
The color to use for the inline layer background. |
clip | number | The coordinates of the inline layer's viewable area. |
height | pixels | The inline layer's height, in pixels. |
left | number | The position of the left side of the inline layer. If the current inline layer is part of another layer.called the parent layer-then the position is relative to the parent layer. |
name | layer name | The name of the inline layer. |
pagex | number | The position of the left side of the inline layer relative to the browser window. |
pagey | number | The position of the top of the inline layer relative to the browser window. |
src | URL | The URL of a page that will appear inside the inline layer. |
top | number | The position of the top of the inline layer. If the current inline layer is part of another layer--called the parent layer--then the position is relative to the parent layer. |
visibility | show hide inherit |
Determines whether the inline layer is visible. |
width | pixels | The inline layer's width, in pixels. |
z-index | number | The inline layer's position within the z-order. Inline layers with higher Z-INDEX values are positioned above inline layers with lower Z-INDEX values. |
Event Attributes
This tag supports all the event attributes described in − HTML Events Reference